﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="装卸量_In.aspx.cs" Inherits="syc.Store.装卸量_In" %>

<html>
<body>
  <head id="Head1" runat="server">
    <title></title>
    <link href="../js/validationEngine.jquery.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery.js" type="text/javascript"></script>
    <script src="../js/jquery.validationEngine-zh_cn.js" type="text/javascript"></script>
    <script src="../js/jquery.validationEngine.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript" src="/common.js"></script>
		<script type="text/javascript">
		    $(document).ready(function() {
		        $("#form1").validationEngine({ promptPosition: "topLeft" })
		    });

		    var textboxs = document.getElementsByTagName("input");
		    document.body.onkeypress = function(e) {
		        if (!e) e = window.event;
		        var tag = e.srcElement;
		        if (!tag) tag = e.target;
		       // if (tag.className.toLowerCase() != "textbox") return;
		        var i;
		        if (e.keyCode == 13) {
		            for (i = 0; i < textboxs.length; i++) {
		                if (tag == textboxs[i]) {
		                    //alert(i);
		                    if (i < textboxs.length - 1) {
		                        textboxs[i + 1].focus();
		                    }
		                    else {
		                        textboxs[textboxs.length].focus();
		                    }
		                }
		            }
		        }
		    }; 
	</script>    
</head>
<body>

    <form id="form1" runat="server">
    <div id="wintop" class="wintop" style="display:none;">生产及销售处装卸量</div>
    <div>
    <asp:Panel ID="Panel1" runat="server" CssClass="panel">
    <table>
    <tr>
    <td><asp:Button ID="save" runat="server" CssClass="button" Text="保 存" 
            onclick="save_Click" /></td>
    <td><input type="button" value="关 闭" class="button" onclick="parent.swin2_close();" /></td>
    <td>年度：</td>
    <td>
      <asp:DropDownList ID="DL_year" runat="server">       
        <asp:ListItem>2010</asp:ListItem>
        <asp:ListItem>2011</asp:ListItem>
        <asp:ListItem>2012</asp:ListItem>
        <asp:ListItem>2013</asp:ListItem>
        <asp:ListItem>2014</asp:ListItem>
        <asp:ListItem>2015</asp:ListItem>
      </asp:DropDownList>
    </td>
    <td>月份：</td>
    <td>
    <asp:DropDownList ID="DL_month" runat="server">
        <asp:ListItem>1</asp:ListItem>   
        <asp:ListItem>2</asp:ListItem>
        <asp:ListItem>3</asp:ListItem>
        <asp:ListItem>4</asp:ListItem>
        <asp:ListItem>5</asp:ListItem>
        <asp:ListItem>6</asp:ListItem>
        <asp:ListItem>7</asp:ListItem>
        <asp:ListItem>8</asp:ListItem>
        <asp:ListItem>9</asp:ListItem>
        <asp:ListItem>11</asp:ListItem>
        <asp:ListItem>12</asp:ListItem>
    </asp:DropDownList>
    </td>
    </tr>
    </table>
    </asp:Panel>
      </asp:Panel>
      <asp:Panel ID="Panel3" runat="server" CssClass="panel2">
        <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
    </asp:Panel>
    <asp:Panel ID="Panel2" runat="server" CssClass="panel" HorizontalAlign="Center">
    <table border="1" style="border-collapse:separate;font-size:14px;margin-bottom:5px;">
    <thead>
    
    </thead>
    <tbody>
        <tr><th style="width:120px;">&nbsp;</th><th>装卸总量(吨)</th></tr>
        <tr>
            <td>一分厂装卸量：</td>
            <td><asp:TextBox runat="server" ID="FenChang1" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"></asp:TextBox></td>           
        </tr>
        <tr>
            <td>二分厂装卸量：</td>
            <td><asp:TextBox runat="server" ID="FenChang2" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"></asp:TextBox></td>           
        </tr>
        <tr>
            <td>三分厂装卸量：</td>
            <td><asp:TextBox runat="server" ID="FenChang3" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"></asp:TextBox></td>           
        </tr>
        <tr>
            <td>五分厂装卸量：</td>
            <td><asp:TextBox runat="server" ID="FenChang5" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"></asp:TextBox></td>           
        </tr>
        <tr>
            <td>销售处发货量：</td>
            <td><asp:TextBox runat="server" ID="XiaoShou" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"></asp:TextBox></td>           
        </tr>
    </tbody>
    </table>
    </asp:Panel>
    </div>
    <asp:Panel ID="Panel_Msg" runat="server" CssClass="panel2">
    <asp:Label ID="Message1" runat="server" Text="·" CssClass="prompt"></asp:Label>
</asp:Panel>        
<asp:SqlDataSource ID="DS1" runat="server" ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
InsertCommand="DELETE FROM [分厂装卸量] WHERE [年度]=@年度 AND [月份]=@月份;
               INSERT INTO [分厂装卸量] ( [年度], [月份], [一分厂装卸总量], [二分厂装卸总量], [三分厂装卸总量], [五分厂装卸总量],[销售处发货量]) 
                           VALUES (@年度, @月份, @一分厂装卸量, @二分厂装卸量,@三分厂装卸量, @五分厂装卸量,@销售处发货量);             
            ">
        <InsertParameters>
                <asp:ControlParameter ControlID="DL_year" PropertyName="SelectedValue" Name="年度" Type="Int32" />
                <asp:ControlParameter ControlID="DL_month" PropertyName="SelectedValue" Name="月份" Type="Int32" />
                <asp:ControlParameter ControlID="FenChang1" PropertyName="Text" Name="一分厂装卸量" Type="Decimal" />
                <asp:ControlParameter ControlID="FenChang2" PropertyName="Text" Name="二分厂装卸量" Type="Decimal" />  
                <asp:ControlParameter ControlID="FenChang3" PropertyName="Text" Name="三分厂装卸量" Type="Decimal" />
                <asp:ControlParameter ControlID="FenChang5" PropertyName="Text" Name="五分厂装卸量" Type="Decimal" />  
                <asp:ControlParameter ControlID="XiaoShou" PropertyName="Text" Name="销售处发货量" Type="Decimal" />                                     
        </InsertParameters>
</asp:SqlDataSource>
 </form>
</body>
</html>
